using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class t_SupplyMap : EntityTypeConfiguration<t_Supply>
    {
        public t_SupplyMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FBrNo, t.FSupID, t.FItemID, t.FPType });

            // Properties
            this.Property(t => t.FBrNo)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.FSupID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FItemID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FPType)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            // Table & Column Mappings
            this.ToTable("t_Supply");
            this.Property(t => t.FBrNo).HasColumnName("FBrNo");
            this.Property(t => t.FSupID).HasColumnName("FSupID");
            this.Property(t => t.FItemID).HasColumnName("FItemID");
            this.Property(t => t.FCurrencyID).HasColumnName("FCurrencyID");
            this.Property(t => t.FPOHighPrice).HasColumnName("FPOHighPrice");
            this.Property(t => t.FPType).HasColumnName("FPType");
        }
    }
}
